﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GeekShop.Commands;

namespace GeekShop.Tools.Fill
{
    public class SolidColor : MouseBehaviour, ITool
    {
        #region Fields
        private ICommand command;
        #endregion

        #region Properties
        public System.Windows.Forms.Cursor Cursor
        {
            get { return Cursors.IBeam; }
        }
        public System.Drawing.Bitmap Icon
        {
            get { return GeekShop.Properties.Resources.color_gradient; }
        }
        public string Name
        {
            get { return "Color Fill"; }
        }
        public ICommand Command { get { return this.command; } }
        #endregion

        #region Methods
        public void RunDialog(PictureManager pictureManager)
        {
            bool ok = true;
            if (ColorDialog.Form == null)
            {
                ColorDialog.Form = new ColorDialog();
                ok = ColorDialog.Form.RunDialog() == DialogResult.OK;
            }
            if (ok)
            {
                this.command = new Commands.Fill.Color(pictureManager.SelectedPicture, ColorDialog.Form.Color);
                this.ToolReady(this, new EventArgs());
            }
        }
        #endregion

        #region Events
        public event EventHandler ToolReady;
        #endregion

        #region Event Methods
        public override void MouseDown(object sender, MouseEventArgs e) { }
        public override void MouseMove(object sender, MouseEventArgs e) { }
        public override void MouseUp(object sender, MouseEventArgs e) { }
        #endregion
    }
}
